<script type="text/javascript">
$(document).ready(function(){
	$(".mclose").click(function(){$(this).parents(".alertBox").hide();});
	$(".modifyiew").click(function(){$(this).parents(".alertBox").hide();});
	$(".modify_menu_bqb_c").click(function(){$("#midify_face_{$topiclist[tid]}").show();});
});

function DelMusic(musicid)
{
	if(musicid > 0) {
		$.post(
			'ajax.php?mod=topic&code=delete_music',
			{
				id:musicid
			},
			function (d) {				
				if(''!=d) {
					//alert(d);
				} else {
					;
				}
			}
		);
		musicid = 0;
	}
	listTopic(0,0);
}
</script>
<div class="editBox">
<div class="dialog_inner">
<div class="mWarp">
<form method="post" action="ajax.php?mod=topic&code=do_modifytopic" enctype="multipart/form-data" name="modify_form" target="modifyframe" id="modify_form">
<div class="mWarp_f">
<div style="float:right;">
<!--{if $this->Config[topic_input_length]>0}-->
<span>还可以输入</span> 
<span id="wordCheck_{$topic_info[tid]}"> <span style="color:#ff0000;font-size:12px;">{conf topic_input_length}</span> </span>
<span style="width:14px;">字</span> 
<!--{/if}-->
</div>
<!--{if $this->Config['channel_enable'] && $channels && $types!='reply_list_ajax'}-->
<select name="item_id" id="item_id" style="margin:0;padding:2px;box-shadow:none; margin-bottom:6px;">
<option value="0" <!--{if !$topiclist['item_id']}-->selected="selected"<!--{/if}-->>选择频道...</option>
<!--{loop $channels $value}-->
<option value="{$value['ch_id']}" <!--{if $value['ch_id']==$topiclist['item_id']}-->selected="selected"<!--{/if}--> <!--{if $value['disabled']}-->disabled=true<!--{/if}-->>{$value['ch_name']}</option>
<!--{/loop}-->
</select>
<!--{/if}-->
</div>

<div class="mWarp_s">
<div class="mWarp_s_t">
<textarea name="content"  id="contents_{$topiclist[tid]}" onkeyup="javascript:checkWord('{conf topic_input_length}', event, 'wordCheck_{$topic_info[tid]}')" class="textarea" style="width:487px; margin-bottom:2px;">{$topiclist[content]}</textarea>
<input name="tid" 		type="hidden" 		id="tids" 		value="{$topiclist[tid]}" />
<input name="imageid" 	type="hidden" 		id="imageids" 	value="{$topiclist[imageid]}" />
<input name="attachid" 	type="hidden" 		id="attachids" 	value="{$topiclist[attachid]}" />
</div>

<div class="modify_tool">
<div class="modify_tool_left">		
<!--{if $this->Config[face_enable]}-->
<div class="menuf_bq" style="position:static;">
<b class="modify_menu_bqb_c"><a href="javascript:void(0);" onclick="topic_face('midify_face_{$topiclist[tid]}','contents_{$topiclist[tid]}');return false;">表情</a></b>
</div>
<div id="midify_face_{$topiclist[tid]}" class="modify_face"></div> 
<!--{/if}-->

<!--{if $this->Config['image_enable']}-->
<!--{if !$topiclist[imageid]}-->
<div class="comment_p_b2 comment_p_b22" id="reply_image_uploadify_{$topiclist[tid]}">
<div onclick="imageUploadifyHTML('{$topiclist[tid]}', 'contents_{$topiclist[tid]}', 'reply_image_uploadify_{$topiclist[tid]}', 1);" class="menuf_tq"><b class="menu_tqb_c">图片</b></div>
</div>
<!--{/if}-->
<!--{/if}-->

<!--{if $this->Config[attach_enable]}-->
<!--{if !$topiclist[attachid]}-->
<div class="comment_p_b2 comment_p_b22" id="reply_attach_uploadify_{$topiclist[tid]}">
<div onclick="attachUploadifyHTML('{$topiclist[tid]}', 'contents_{$topiclist[tid]}', 'reply_attach_uploadify_{$topiclist[tid]}', 1);" class="menuf_fj menu_fj_reply_style"><b class="menu_fjb_c">附件</b></div>
</div>
<!--{/if}-->
<!--{/if}-->


</div>
<div class="modify_tool_right" style="margin-bottom:10px;">
<input name="modify_{$topiclist[tid]}" type="button" class="btnText modifyiew" id="modifySubmit" onclick="do_modifyTopic('{$topiclist[tid]}','imageids','attachids','contents_{$topiclist[tid]}','{$types}', '{$handle_key}');return false;" value="提 交" title="按Ctrl+Enter直接提交"/>
</div>
</div>

</div>
</form>
<!--{if $this->Config[attach_enable] && $topiclist[attachid]}-->
<!--上传附件-->     
<!--{eval $attach_uploadify_topic = $topiclist;}-->
<!--{eval $attach_uploadify_modify = 1;}--> 
<!--{eval $attach_uploadify_topic_uid = $topiclist[uid];}--> 
<!--{eval $topic_textarea_id = 'contents_'.$topiclist[tid];}-->
{template "attach_uploadify.inc"}
<style type="text/css">.insertAttachDiv_up{ display:none;}</style>
<!--上传附件-->
<!--{/if}-->

<!--{if $this->Config['image_enable'] && $topiclist[imageid]}-->
<!--上传图片-->       
<!--{eval $image_uploadify_topic = $topiclist;}-->
<!--{eval $image_uploadify_modify = 1;}--> 
<!--{eval $image_uploadify_topic_uid = $topiclist[uid];}--> 
<!--{eval $content_textarea_id = 'contents_'.$topiclist[tid];}-->
{template "image_uploadify.inc"}
<style type="text/css">.insertImgDiv_up{ display:none;}</style>
<!--上传图片-->	
<!--{/if}-->

<!--内容操作-->
</div>	  
</div>
</div>
<script language="Javascript">
$("#contents_{$topiclist[tid]}").bind('keydown',function(event){
	event = event || window.event;
    if (event.keyCode == 13 && event.ctrlKey) {
        $("#modifySubmit").click();
    }
});

//输入时自动提醒
$(document).ready(function(){
	initAiInput("contents_{$topiclist[tid]}");$('#contents_{$topiclist[tid]}').setCaret();$('#contents_{$topiclist[tid]}').autoTextarea({maxHeight:220});
});
</script>
<script language="Javascript">

String.prototype.trim = function() 
{ 
	return this.replace(/(^\s*)|(\s*$)/g, ""); 
}

</script>
